<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml"
	xmlns:ui="http://java.sun.com/jsf/facelets"
	xmlns:h="http://java.sun.com/jsf/html"
	xmlns:f="http://java.sun.com/jsf/core"
	xmlns:p="http://primefaces.org/ui">

<h:head>
	<title>ACADEMY</title>
	<meta http-equiv="Content-Type" content="text/html; charset= UTF-8" />
	<link rel="stylesheet" type="text/css" href="css/academy.css" />
</h:head>
<h:body>
	<div id="Titulo">ACADEMY JAVA WEB</div>
	<img src="img/Academy.jpg" width="120" height="100" />
	<div id="heading">
		<ui:insert name="heading">
			<ui:include src="menu/menu.xhtml" />
		</ui:insert>
	</div>

	<h:form>

		<p:inputText id="palavraChave" value="#{listarPessoaMB.nomePesq}" />
		<p:commandButton value="Pesquisar" update="tabela"
			action="#{listarPessoaMB.iniciarTabela()}" style="margin:0" />

		<p:dataTable id="tabela" var="pessoas"
			value="#{listarPessoaMB.pessoas}"
			selection="#{listarPessoaMB.pessoaSelec}" selectionMode="single"
			rowKey="#{pessoas.id}" paginator="true">
			<p:column headerText="ID">
				<h:outputText value="#{pessoas.id}" />
			</p:column>
			<p:column headerText="Nome">
				<h:outputText value="#{pessoas.nome}" />
			</p:column>

		</p:dataTable>

		<p:commandButton value="Cadastro"
			action="#{listarPessoaMB.cadastrar()}" icon="ui-icon-check"
			style="margin:0" />
		<p:commandButton value="Editar" action="#{listarPessoaMB.editar()}"
			icon="ui-icon-pencil" style="margin:0" />
		<p:commandButton value="Remover" action="#{listarPessoaMB.remover()}"
			update="tabela" icon="ui-icon-close" style="margin:0" />

	</h:form>
</h:body>
</html>